<?php

namespace App\Admin\Exports\Sheet;

use App\Models\Virtual\Virtual;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithTitle;
class VirtualSheet implements FromCollection, WithHeadings, WithTitle
{
    public function collection()
    {
        return Virtual::query()->select([
            'id', 'category_id', 'unit_id', 'unit_name', 'page_number',
            'title', 'image', 'video', 'is_read','mobile_image','unit_main_name'
        ])->get();
    }

    public function headings(): array
    {
        return [
            '情境学习编号', '年级编号', '单元名称', '定制单元名称','页码','书页标题','封面图','视频地址','是否跟读','竖版封面','主单元名称'
        ];
    }
    public function title(): string
    {
        return '情境学习';
    }
}
